package com.neuedu.yyzx.controller;

import com.neuedu.yyzx.common.Ret;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 金山
 * 项目：yyzx
 * site: https://blog.fulfill.com.cn
 * 描述
 * @data 2025/3/2514:04
 */
@RestController
@Tag(name = "数学运算模块")
public class IndexController {

    @RequestMapping("/")
    String index() {
        return "success";
    }


    @Operation(summary = "除法运算")
    @Parameters(
            value = {
                    @Parameter(name = "numa", description = "被除数"),
                    @Parameter(name = "numb", description = "除数", required = false, in = ParameterIn.QUERY, schema = @Schema(type = "Long"))
            }
    )
    @GetMapping("/div")
    Ret<String> div(int numa, int numb) {

        return Ret.ok("结果: " + (numa / numb));

    }

}
